package com.ruoyi.iot.domain;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;

/**
 * 控制设备连接时认证和授权，从数据库校验确认，包含mqtt和tcp，不能任意设备都可以连接服务器
 */
@Data
public class DeviceAcl implements Serializable {

    private static final long serialVersionUID = 1L;

    private String clientid;
    private String username;
    //操作类型，'1' 订阅；'2' 发布
    private String action;
    private String ipaddr;
    private String topic;
    //分布式挂载的节点服务器
    private String mountpoint;
    private String password;
    //"result": "allow" | "deny" | "ignore", // Default `"ignore"`
    private String result = "deny";

    // "is_superuser": true | false
    @JSONField(name = "is_superuser")
    private boolean is_superuser = false;
}
